﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AcceptanceTest.Framework;

namespace AcceptanceTest.PasswordSample
{
    [StepDefinition("Password Test")]
    public class PasswordTestSteps
    {
        private bool isValid;

        [Step(@"^password (.+) is checked$")]
        public void ValidaPassword(string password)
        {
            isValid = PasswordValidator.IsValidPassword(password);
        }

        [Step(@"^it should fail$")]
        public void ItShouldFail()
        {
            if (isValid) throw new Exception("Password is expected to be invalid, but is marked as valid.");
        }

        [Step(@"^it should pass$")]
        public void ItShouldPass()
        {
            if (!isValid) throw new Exception("Password is expected to be valid, but is marked as invalid.");
        }

    }
}
